package edu.sctu.practice.class01.zhoumengxue.assign.assign03.assign03_1;

/**
 * Created by ASUS on 2015/10/22.
 */
public class Main {

    public static void main(String[] args) {

        GeometricObject object1 = new GeometricObject("红色", 2, 4){
            @Override
            public double findArea() {
                return 0;
            }

            @Override
            public double findPerimeter() {
                return 0;
            }
        };

        GeometricObject object2 = new GeometricObject("红色", 3, 6) {
            @Override
            public double findArea() {
                return 0;
            }

            @Override
            public double findPerimeter() {
                return 0;
            }
        };

//圆面积，周长
        Circle circle = new Circle("红色", 3, 6);
        circle.width = 5;
        circle.findArea();
        circle.findPerimeter();

//矩形面积，周长
        Rectangle rectangle = new Rectangle("红色", 2, 4);
        rectangle.length = 6;
        rectangle.width = 4;
        rectangle.findArea();
        rectangle.findPerimeter();

//比较及显示
        System.out.println("面积是否相同：" + equalArea(circle, rectangle));

    }

    public static boolean equalArea(GeometricObject object1, GeometricObject object2) {

        if (object1.equals(object2)) {
            return true;
        } else {
            return false;
        }

    }


}
